package com.wetech.demo.web3j.contracts.iaccessmanager;

import io.reactivex.Flowable;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Callable;
import org.web3j.abi.EventEncoder;
import org.web3j.abi.TypeReference;
import org.web3j.abi.datatypes.Address;
import org.web3j.abi.datatypes.Bool;
import org.web3j.abi.datatypes.CustomError;
import org.web3j.abi.datatypes.DynamicBytes;
import org.web3j.abi.datatypes.Event;
import org.web3j.abi.datatypes.Function;
import org.web3j.abi.datatypes.Type;
import org.web3j.abi.datatypes.Utf8String;
import org.web3j.abi.datatypes.generated.Bytes32;
import org.web3j.abi.datatypes.generated.Bytes4;
import org.web3j.abi.datatypes.generated.Uint32;
import org.web3j.abi.datatypes.generated.Uint48;
import org.web3j.abi.datatypes.generated.Uint64;
import org.web3j.crypto.Credentials;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.core.DefaultBlockParameter;
import org.web3j.protocol.core.RemoteCall;
import org.web3j.protocol.core.RemoteFunctionCall;
import org.web3j.protocol.core.methods.request.EthFilter;
import org.web3j.protocol.core.methods.response.BaseEventResponse;
import org.web3j.protocol.core.methods.response.Log;
import org.web3j.protocol.core.methods.response.TransactionReceipt;
import org.web3j.tuples.generated.Tuple2;
import org.web3j.tuples.generated.Tuple4;
import org.web3j.tx.Contract;
import org.web3j.tx.TransactionManager;
import org.web3j.tx.gas.ContractGasProvider;

/**
 * <p>Auto generated code.
 * <p><strong>Do not modify!</strong>
 * <p>Please use the <a href="https://docs.web3j.io/command_line.html">web3j command line tools</a>,
 * or the org.web3j.codegen.SolidityFunctionWrapperGenerator in the 
 * <a href="https://github.com/LFDT-web3j/web3j/tree/main/codegen">codegen module</a> to update.
 *
 * <p>Generated with web3j version 4.14.0.
 */
@SuppressWarnings("rawtypes")
public class IAccessManager extends Contract {
    public static final String BINARY = "";

    private static String librariesLinkedBinary;

    public static final String FUNC_CANCALL = "canCall";

    public static final String FUNC_CANCEL = "cancel";

    public static final String FUNC_CONSUMESCHEDULEDOP = "consumeScheduledOp";

    public static final String FUNC_EXECUTE = "execute";

    public static final String FUNC_EXPIRATION = "expiration";

    public static final String FUNC_GETACCESS = "getAccess";

    public static final String FUNC_GETNONCE = "getNonce";

    public static final String FUNC_GETROLEADMIN = "getRoleAdmin";

    public static final String FUNC_GETROLEGRANTDELAY = "getRoleGrantDelay";

    public static final String FUNC_GETROLEGUARDIAN = "getRoleGuardian";

    public static final String FUNC_GETSCHEDULE = "getSchedule";

    public static final String FUNC_GETTARGETADMINDELAY = "getTargetAdminDelay";

    public static final String FUNC_GETTARGETFUNCTIONROLE = "getTargetFunctionRole";

    public static final String FUNC_GRANTROLE = "grantRole";

    public static final String FUNC_HASROLE = "hasRole";

    public static final String FUNC_HASHOPERATION = "hashOperation";

    public static final String FUNC_ISTARGETCLOSED = "isTargetClosed";

    public static final String FUNC_LABELROLE = "labelRole";

    public static final String FUNC_MINSETBACK = "minSetback";

    public static final String FUNC_RENOUNCEROLE = "renounceRole";

    public static final String FUNC_REVOKEROLE = "revokeRole";

    public static final String FUNC_SCHEDULE = "schedule";

    public static final String FUNC_SETGRANTDELAY = "setGrantDelay";

    public static final String FUNC_SETROLEADMIN = "setRoleAdmin";

    public static final String FUNC_SETROLEGUARDIAN = "setRoleGuardian";

    public static final String FUNC_SETTARGETADMINDELAY = "setTargetAdminDelay";

    public static final String FUNC_SETTARGETCLOSED = "setTargetClosed";

    public static final String FUNC_SETTARGETFUNCTIONROLE = "setTargetFunctionRole";

    public static final String FUNC_UPDATEAUTHORITY = "updateAuthority";

    public static final CustomError ACCESSMANAGERALREADYSCHEDULED_ERROR = new CustomError("AccessManagerAlreadyScheduled", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
    ;

    public static final CustomError ACCESSMANAGERBADCONFIRMATION_ERROR = new CustomError("AccessManagerBadConfirmation", 
            Arrays.<TypeReference<?>>asList());
    ;

    public static final CustomError ACCESSMANAGEREXPIRED_ERROR = new CustomError("AccessManagerExpired", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
    ;

    public static final CustomError ACCESSMANAGERINVALIDINITIALADMIN_ERROR = new CustomError("AccessManagerInvalidInitialAdmin", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final CustomError ACCESSMANAGERLOCKEDROLE_ERROR = new CustomError("AccessManagerLockedRole", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>() {}));
    ;

    public static final CustomError ACCESSMANAGERNOTREADY_ERROR = new CustomError("AccessManagerNotReady", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
    ;

    public static final CustomError ACCESSMANAGERNOTSCHEDULED_ERROR = new CustomError("AccessManagerNotScheduled", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
    ;

    public static final CustomError ACCESSMANAGERUNAUTHORIZEDACCOUNT_ERROR = new CustomError("AccessManagerUnauthorizedAccount", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Uint64>() {}));
    ;

    public static final CustomError ACCESSMANAGERUNAUTHORIZEDCALL_ERROR = new CustomError("AccessManagerUnauthorizedCall", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Bytes4>() {}));
    ;

    public static final CustomError ACCESSMANAGERUNAUTHORIZEDCANCEL_ERROR = new CustomError("AccessManagerUnauthorizedCancel", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<Bytes4>() {}));
    ;

    public static final CustomError ACCESSMANAGERUNAUTHORIZEDCONSUME_ERROR = new CustomError("AccessManagerUnauthorizedConsume", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>() {}));
    ;

    public static final Event OPERATIONCANCELED_EVENT = new Event("OperationCanceled", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>(true) {}, new TypeReference<Uint32>(true) {}));
    ;

    public static final Event OPERATIONEXECUTED_EVENT = new Event("OperationExecuted", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>(true) {}, new TypeReference<Uint32>(true) {}));
    ;

    public static final Event OPERATIONSCHEDULED_EVENT = new Event("OperationScheduled", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>(true) {}, new TypeReference<Uint32>(true) {}, new TypeReference<Uint48>() {}, new TypeReference<Address>() {}, new TypeReference<Address>() {}, new TypeReference<DynamicBytes>() {}));
    ;

    public static final Event ROLEADMINCHANGED_EVENT = new Event("RoleAdminChanged", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>(true) {}, new TypeReference<Uint64>(true) {}));
    ;

    public static final Event ROLEGRANTDELAYCHANGED_EVENT = new Event("RoleGrantDelayChanged", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>(true) {}, new TypeReference<Uint32>() {}, new TypeReference<Uint48>() {}));
    ;

    public static final Event ROLEGRANTED_EVENT = new Event("RoleGranted", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>(true) {}, new TypeReference<Address>(true) {}, new TypeReference<Uint32>() {}, new TypeReference<Uint48>() {}, new TypeReference<Bool>() {}));
    ;

    public static final Event ROLEGUARDIANCHANGED_EVENT = new Event("RoleGuardianChanged", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>(true) {}, new TypeReference<Uint64>(true) {}));
    ;

    public static final Event ROLELABEL_EVENT = new Event("RoleLabel", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>(true) {}, new TypeReference<Utf8String>() {}));
    ;

    public static final Event ROLEREVOKED_EVENT = new Event("RoleRevoked", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>(true) {}, new TypeReference<Address>(true) {}));
    ;

    public static final Event TARGETADMINDELAYUPDATED_EVENT = new Event("TargetAdminDelayUpdated", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Uint32>() {}, new TypeReference<Uint48>() {}));
    ;

    public static final Event TARGETCLOSED_EVENT = new Event("TargetClosed", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Bool>() {}));
    ;

    public static final Event TARGETFUNCTIONROLEUPDATED_EVENT = new Event("TargetFunctionRoleUpdated", 
            Arrays.<TypeReference<?>>asList(new TypeReference<Address>(true) {}, new TypeReference<Bytes4>() {}, new TypeReference<Uint64>(true) {}));
    ;

    @Deprecated
    protected IAccessManager(String contractAddress, Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    protected IAccessManager(String contractAddress, Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, credentials, contractGasProvider);
    }

    @Deprecated
    protected IAccessManager(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        super(BINARY, contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    protected IAccessManager(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        super(BINARY, contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static List<OperationCanceledEventResponse> getOperationCanceledEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OPERATIONCANCELED_EVENT, transactionReceipt);
        ArrayList<OperationCanceledEventResponse> responses = new ArrayList<OperationCanceledEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            OperationCanceledEventResponse typedResponse = new OperationCanceledEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.operationId = (byte[]) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.nonce = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static OperationCanceledEventResponse getOperationCanceledEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OPERATIONCANCELED_EVENT, log);
        OperationCanceledEventResponse typedResponse = new OperationCanceledEventResponse();
        typedResponse.log = log;
        typedResponse.operationId = (byte[]) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.nonce = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<OperationCanceledEventResponse> operationCanceledEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOperationCanceledEventFromLog(log));
    }

    public Flowable<OperationCanceledEventResponse> operationCanceledEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OPERATIONCANCELED_EVENT));
        return operationCanceledEventFlowable(filter);
    }

    public static List<OperationExecutedEventResponse> getOperationExecutedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OPERATIONEXECUTED_EVENT, transactionReceipt);
        ArrayList<OperationExecutedEventResponse> responses = new ArrayList<OperationExecutedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            OperationExecutedEventResponse typedResponse = new OperationExecutedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.operationId = (byte[]) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.nonce = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static OperationExecutedEventResponse getOperationExecutedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OPERATIONEXECUTED_EVENT, log);
        OperationExecutedEventResponse typedResponse = new OperationExecutedEventResponse();
        typedResponse.log = log;
        typedResponse.operationId = (byte[]) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.nonce = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<OperationExecutedEventResponse> operationExecutedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOperationExecutedEventFromLog(log));
    }

    public Flowable<OperationExecutedEventResponse> operationExecutedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OPERATIONEXECUTED_EVENT));
        return operationExecutedEventFlowable(filter);
    }

    public static List<OperationScheduledEventResponse> getOperationScheduledEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(OPERATIONSCHEDULED_EVENT, transactionReceipt);
        ArrayList<OperationScheduledEventResponse> responses = new ArrayList<OperationScheduledEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            OperationScheduledEventResponse typedResponse = new OperationScheduledEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.operationId = (byte[]) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.nonce = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.schedule = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.caller = (String) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.target = (String) eventValues.getNonIndexedValues().get(2).getValue();
            typedResponse.data = (byte[]) eventValues.getNonIndexedValues().get(3).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static OperationScheduledEventResponse getOperationScheduledEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(OPERATIONSCHEDULED_EVENT, log);
        OperationScheduledEventResponse typedResponse = new OperationScheduledEventResponse();
        typedResponse.log = log;
        typedResponse.operationId = (byte[]) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.nonce = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.schedule = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.caller = (String) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.target = (String) eventValues.getNonIndexedValues().get(2).getValue();
        typedResponse.data = (byte[]) eventValues.getNonIndexedValues().get(3).getValue();
        return typedResponse;
    }

    public Flowable<OperationScheduledEventResponse> operationScheduledEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getOperationScheduledEventFromLog(log));
    }

    public Flowable<OperationScheduledEventResponse> operationScheduledEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(OPERATIONSCHEDULED_EVENT));
        return operationScheduledEventFlowable(filter);
    }

    public static List<RoleAdminChangedEventResponse> getRoleAdminChangedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, transactionReceipt);
        ArrayList<RoleAdminChangedEventResponse> responses = new ArrayList<RoleAdminChangedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            RoleAdminChangedEventResponse typedResponse = new RoleAdminChangedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.admin = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RoleAdminChangedEventResponse getRoleAdminChangedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEADMINCHANGED_EVENT, log);
        RoleAdminChangedEventResponse typedResponse = new RoleAdminChangedEventResponse();
        typedResponse.log = log;
        typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.admin = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<RoleAdminChangedEventResponse> roleAdminChangedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleAdminChangedEventFromLog(log));
    }

    public Flowable<RoleAdminChangedEventResponse> roleAdminChangedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEADMINCHANGED_EVENT));
        return roleAdminChangedEventFlowable(filter);
    }

    public static List<RoleGrantDelayChangedEventResponse> getRoleGrantDelayChangedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEGRANTDELAYCHANGED_EVENT, transactionReceipt);
        ArrayList<RoleGrantDelayChangedEventResponse> responses = new ArrayList<RoleGrantDelayChangedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            RoleGrantDelayChangedEventResponse typedResponse = new RoleGrantDelayChangedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.delay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.since = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RoleGrantDelayChangedEventResponse getRoleGrantDelayChangedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEGRANTDELAYCHANGED_EVENT, log);
        RoleGrantDelayChangedEventResponse typedResponse = new RoleGrantDelayChangedEventResponse();
        typedResponse.log = log;
        typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.delay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.since = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<RoleGrantDelayChangedEventResponse> roleGrantDelayChangedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleGrantDelayChangedEventFromLog(log));
    }

    public Flowable<RoleGrantDelayChangedEventResponse> roleGrantDelayChangedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEGRANTDELAYCHANGED_EVENT));
        return roleGrantDelayChangedEventFlowable(filter);
    }

    public static List<RoleGrantedEventResponse> getRoleGrantedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, transactionReceipt);
        ArrayList<RoleGrantedEventResponse> responses = new ArrayList<RoleGrantedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            RoleGrantedEventResponse typedResponse = new RoleGrantedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.delay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.since = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
            typedResponse.newMember = (Boolean) eventValues.getNonIndexedValues().get(2).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RoleGrantedEventResponse getRoleGrantedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEGRANTED_EVENT, log);
        RoleGrantedEventResponse typedResponse = new RoleGrantedEventResponse();
        typedResponse.log = log;
        typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.delay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.since = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        typedResponse.newMember = (Boolean) eventValues.getNonIndexedValues().get(2).getValue();
        return typedResponse;
    }

    public Flowable<RoleGrantedEventResponse> roleGrantedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleGrantedEventFromLog(log));
    }

    public Flowable<RoleGrantedEventResponse> roleGrantedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEGRANTED_EVENT));
        return roleGrantedEventFlowable(filter);
    }

    public static List<RoleGuardianChangedEventResponse> getRoleGuardianChangedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEGUARDIANCHANGED_EVENT, transactionReceipt);
        ArrayList<RoleGuardianChangedEventResponse> responses = new ArrayList<RoleGuardianChangedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            RoleGuardianChangedEventResponse typedResponse = new RoleGuardianChangedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.guardian = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RoleGuardianChangedEventResponse getRoleGuardianChangedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEGUARDIANCHANGED_EVENT, log);
        RoleGuardianChangedEventResponse typedResponse = new RoleGuardianChangedEventResponse();
        typedResponse.log = log;
        typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.guardian = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<RoleGuardianChangedEventResponse> roleGuardianChangedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleGuardianChangedEventFromLog(log));
    }

    public Flowable<RoleGuardianChangedEventResponse> roleGuardianChangedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEGUARDIANCHANGED_EVENT));
        return roleGuardianChangedEventFlowable(filter);
    }

    public static List<RoleLabelEventResponse> getRoleLabelEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLELABEL_EVENT, transactionReceipt);
        ArrayList<RoleLabelEventResponse> responses = new ArrayList<RoleLabelEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            RoleLabelEventResponse typedResponse = new RoleLabelEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.label = (String) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RoleLabelEventResponse getRoleLabelEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLELABEL_EVENT, log);
        RoleLabelEventResponse typedResponse = new RoleLabelEventResponse();
        typedResponse.log = log;
        typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.label = (String) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<RoleLabelEventResponse> roleLabelEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleLabelEventFromLog(log));
    }

    public Flowable<RoleLabelEventResponse> roleLabelEventFlowable(DefaultBlockParameter startBlock,
            DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLELABEL_EVENT));
        return roleLabelEventFlowable(filter);
    }

    public static List<RoleRevokedEventResponse> getRoleRevokedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, transactionReceipt);
        ArrayList<RoleRevokedEventResponse> responses = new ArrayList<RoleRevokedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            RoleRevokedEventResponse typedResponse = new RoleRevokedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static RoleRevokedEventResponse getRoleRevokedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(ROLEREVOKED_EVENT, log);
        RoleRevokedEventResponse typedResponse = new RoleRevokedEventResponse();
        typedResponse.log = log;
        typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.account = (String) eventValues.getIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<RoleRevokedEventResponse> roleRevokedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getRoleRevokedEventFromLog(log));
    }

    public Flowable<RoleRevokedEventResponse> roleRevokedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(ROLEREVOKED_EVENT));
        return roleRevokedEventFlowable(filter);
    }

    public static List<TargetAdminDelayUpdatedEventResponse> getTargetAdminDelayUpdatedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(TARGETADMINDELAYUPDATED_EVENT, transactionReceipt);
        ArrayList<TargetAdminDelayUpdatedEventResponse> responses = new ArrayList<TargetAdminDelayUpdatedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            TargetAdminDelayUpdatedEventResponse typedResponse = new TargetAdminDelayUpdatedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.target = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.delay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
            typedResponse.since = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static TargetAdminDelayUpdatedEventResponse getTargetAdminDelayUpdatedEventFromLog(
            Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TARGETADMINDELAYUPDATED_EVENT, log);
        TargetAdminDelayUpdatedEventResponse typedResponse = new TargetAdminDelayUpdatedEventResponse();
        typedResponse.log = log;
        typedResponse.target = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.delay = (BigInteger) eventValues.getNonIndexedValues().get(0).getValue();
        typedResponse.since = (BigInteger) eventValues.getNonIndexedValues().get(1).getValue();
        return typedResponse;
    }

    public Flowable<TargetAdminDelayUpdatedEventResponse> targetAdminDelayUpdatedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getTargetAdminDelayUpdatedEventFromLog(log));
    }

    public Flowable<TargetAdminDelayUpdatedEventResponse> targetAdminDelayUpdatedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(TARGETADMINDELAYUPDATED_EVENT));
        return targetAdminDelayUpdatedEventFlowable(filter);
    }

    public static List<TargetClosedEventResponse> getTargetClosedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(TARGETCLOSED_EVENT, transactionReceipt);
        ArrayList<TargetClosedEventResponse> responses = new ArrayList<TargetClosedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            TargetClosedEventResponse typedResponse = new TargetClosedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.target = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.closed = (Boolean) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static TargetClosedEventResponse getTargetClosedEventFromLog(Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TARGETCLOSED_EVENT, log);
        TargetClosedEventResponse typedResponse = new TargetClosedEventResponse();
        typedResponse.log = log;
        typedResponse.target = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.closed = (Boolean) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<TargetClosedEventResponse> targetClosedEventFlowable(EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getTargetClosedEventFromLog(log));
    }

    public Flowable<TargetClosedEventResponse> targetClosedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(TARGETCLOSED_EVENT));
        return targetClosedEventFlowable(filter);
    }

    public static List<TargetFunctionRoleUpdatedEventResponse> getTargetFunctionRoleUpdatedEvents(
            TransactionReceipt transactionReceipt) {
        List<Contract.EventValuesWithLog> valueList = staticExtractEventParametersWithLog(TARGETFUNCTIONROLEUPDATED_EVENT, transactionReceipt);
        ArrayList<TargetFunctionRoleUpdatedEventResponse> responses = new ArrayList<TargetFunctionRoleUpdatedEventResponse>(valueList.size());
        for (Contract.EventValuesWithLog eventValues : valueList) {
            TargetFunctionRoleUpdatedEventResponse typedResponse = new TargetFunctionRoleUpdatedEventResponse();
            typedResponse.log = eventValues.getLog();
            typedResponse.target = (String) eventValues.getIndexedValues().get(0).getValue();
            typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
            typedResponse.selector = (byte[]) eventValues.getNonIndexedValues().get(0).getValue();
            responses.add(typedResponse);
        }
        return responses;
    }

    public static TargetFunctionRoleUpdatedEventResponse getTargetFunctionRoleUpdatedEventFromLog(
            Log log) {
        Contract.EventValuesWithLog eventValues = staticExtractEventParametersWithLog(TARGETFUNCTIONROLEUPDATED_EVENT, log);
        TargetFunctionRoleUpdatedEventResponse typedResponse = new TargetFunctionRoleUpdatedEventResponse();
        typedResponse.log = log;
        typedResponse.target = (String) eventValues.getIndexedValues().get(0).getValue();
        typedResponse.roleId = (BigInteger) eventValues.getIndexedValues().get(1).getValue();
        typedResponse.selector = (byte[]) eventValues.getNonIndexedValues().get(0).getValue();
        return typedResponse;
    }

    public Flowable<TargetFunctionRoleUpdatedEventResponse> targetFunctionRoleUpdatedEventFlowable(
            EthFilter filter) {
        return web3j.ethLogFlowable(filter).map(log -> getTargetFunctionRoleUpdatedEventFromLog(log));
    }

    public Flowable<TargetFunctionRoleUpdatedEventResponse> targetFunctionRoleUpdatedEventFlowable(
            DefaultBlockParameter startBlock, DefaultBlockParameter endBlock) {
        EthFilter filter = new EthFilter(startBlock, endBlock, getContractAddress());
        filter.addSingleTopic(EventEncoder.encode(TARGETFUNCTIONROLEUPDATED_EVENT));
        return targetFunctionRoleUpdatedEventFlowable(filter);
    }

    public RemoteFunctionCall<Tuple2<Boolean, BigInteger>> canCall(String caller, String target,
            byte[] selector) {
        final Function function = new Function(FUNC_CANCALL, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, caller), 
                new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.generated.Bytes4(selector)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}, new TypeReference<Uint32>() {}));
        return new RemoteFunctionCall<Tuple2<Boolean, BigInteger>>(function,
                new Callable<Tuple2<Boolean, BigInteger>>() {
                    @Override
                    public Tuple2<Boolean, BigInteger> call() throws Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple2<Boolean, BigInteger>(
                                (Boolean) results.get(0).getValue(), 
                                (BigInteger) results.get(1).getValue());
                    }
                });
    }

    public RemoteFunctionCall<TransactionReceipt> cancel(String caller, String target,
            byte[] data) {
        final Function function = new Function(
                FUNC_CANCEL, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, caller), 
                new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.DynamicBytes(data)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> consumeScheduledOp(String caller, byte[] data) {
        final Function function = new Function(
                FUNC_CONSUMESCHEDULEDOP, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, caller), 
                new org.web3j.abi.datatypes.DynamicBytes(data)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> execute(String target, byte[] data,
            BigInteger weiValue) {
        final Function function = new Function(
                FUNC_EXECUTE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.DynamicBytes(data)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function, weiValue);
    }

    public RemoteFunctionCall<BigInteger> expiration() {
        final Function function = new Function(FUNC_EXPIRATION, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint32>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>> getAccess(
            BigInteger roleId, String account) {
        final Function function = new Function(FUNC_GETACCESS, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.Address(160, account)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint48>() {}, new TypeReference<Uint32>() {}, new TypeReference<Uint32>() {}, new TypeReference<Uint48>() {}));
        return new RemoteFunctionCall<Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>>(function,
                new Callable<Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>>() {
                    @Override
                    public Tuple4<BigInteger, BigInteger, BigInteger, BigInteger> call() throws
                            Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple4<BigInteger, BigInteger, BigInteger, BigInteger>(
                                (BigInteger) results.get(0).getValue(), 
                                (BigInteger) results.get(1).getValue(), 
                                (BigInteger) results.get(2).getValue(), 
                                (BigInteger) results.get(3).getValue());
                    }
                });
    }

    public RemoteFunctionCall<BigInteger> getNonce(byte[] id) {
        final Function function = new Function(FUNC_GETNONCE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(id)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint32>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getRoleAdmin(BigInteger roleId) {
        final Function function = new Function(FUNC_GETROLEADMIN, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getRoleGrantDelay(BigInteger roleId) {
        final Function function = new Function(FUNC_GETROLEGRANTDELAY, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint32>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getRoleGuardian(BigInteger roleId) {
        final Function function = new Function(FUNC_GETROLEGUARDIAN, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getSchedule(byte[] id) {
        final Function function = new Function(FUNC_GETSCHEDULE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Bytes32(id)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint48>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getTargetAdminDelay(String target) {
        final Function function = new Function(FUNC_GETTARGETADMINDELAY, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint32>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<BigInteger> getTargetFunctionRole(String target, byte[] selector) {
        final Function function = new Function(FUNC_GETTARGETFUNCTIONROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.generated.Bytes4(selector)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint64>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> grantRole(BigInteger roleId, String account,
            BigInteger executionDelay) {
        final Function function = new Function(
                FUNC_GRANTROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.Address(160, account), 
                new org.web3j.abi.datatypes.generated.Uint32(executionDelay)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<Tuple2<Boolean, BigInteger>> hasRole(BigInteger roleId,
            String account) {
        final Function function = new Function(FUNC_HASROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.Address(160, account)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}, new TypeReference<Uint32>() {}));
        return new RemoteFunctionCall<Tuple2<Boolean, BigInteger>>(function,
                new Callable<Tuple2<Boolean, BigInteger>>() {
                    @Override
                    public Tuple2<Boolean, BigInteger> call() throws Exception {
                        List<Type> results = executeCallMultipleValueReturn(function);
                        return new Tuple2<Boolean, BigInteger>(
                                (Boolean) results.get(0).getValue(), 
                                (BigInteger) results.get(1).getValue());
                    }
                });
    }

    public RemoteFunctionCall<byte[]> hashOperation(String caller, String target, byte[] data) {
        final Function function = new Function(FUNC_HASHOPERATION, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, caller), 
                new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.DynamicBytes(data)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bytes32>() {}));
        return executeRemoteCallSingleValueReturn(function, byte[].class);
    }

    public RemoteFunctionCall<Boolean> isTargetClosed(String target) {
        final Function function = new Function(FUNC_ISTARGETCLOSED, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target)), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Bool>() {}));
        return executeRemoteCallSingleValueReturn(function, Boolean.class);
    }

    public RemoteFunctionCall<TransactionReceipt> labelRole(BigInteger roleId, String label) {
        final Function function = new Function(
                FUNC_LABELROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.Utf8String(label)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<BigInteger> minSetback() {
        final Function function = new Function(FUNC_MINSETBACK, 
                Arrays.<Type>asList(), 
                Arrays.<TypeReference<?>>asList(new TypeReference<Uint32>() {}));
        return executeRemoteCallSingleValueReturn(function, BigInteger.class);
    }

    public RemoteFunctionCall<TransactionReceipt> renounceRole(BigInteger roleId,
            String callerConfirmation) {
        final Function function = new Function(
                FUNC_RENOUNCEROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.Address(160, callerConfirmation)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> revokeRole(BigInteger roleId, String account) {
        final Function function = new Function(
                FUNC_REVOKEROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.Address(160, account)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> schedule(String target, byte[] data,
            BigInteger when) {
        final Function function = new Function(
                FUNC_SCHEDULE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.DynamicBytes(data), 
                new org.web3j.abi.datatypes.generated.Uint48(when)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setGrantDelay(BigInteger roleId,
            BigInteger newDelay) {
        final Function function = new Function(
                FUNC_SETGRANTDELAY, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.generated.Uint32(newDelay)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setRoleAdmin(BigInteger roleId,
            BigInteger admin) {
        final Function function = new Function(
                FUNC_SETROLEADMIN, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.generated.Uint64(admin)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setRoleGuardian(BigInteger roleId,
            BigInteger guardian) {
        final Function function = new Function(
                FUNC_SETROLEGUARDIAN, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.generated.Uint64(roleId), 
                new org.web3j.abi.datatypes.generated.Uint64(guardian)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setTargetAdminDelay(String target,
            BigInteger newDelay) {
        final Function function = new Function(
                FUNC_SETTARGETADMINDELAY, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.generated.Uint32(newDelay)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setTargetClosed(String target, Boolean closed) {
        final Function function = new Function(
                FUNC_SETTARGETCLOSED, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.Bool(closed)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> setTargetFunctionRole(String target,
            List<byte[]> selectors, BigInteger roleId) {
        final Function function = new Function(
                FUNC_SETTARGETFUNCTIONROLE, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.DynamicArray<org.web3j.abi.datatypes.generated.Bytes4>(
                        org.web3j.abi.datatypes.generated.Bytes4.class,
                        org.web3j.abi.Utils.typeMap(selectors, org.web3j.abi.datatypes.generated.Bytes4.class)), 
                new org.web3j.abi.datatypes.generated.Uint64(roleId)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    public RemoteFunctionCall<TransactionReceipt> updateAuthority(String target,
            String newAuthority) {
        final Function function = new Function(
                FUNC_UPDATEAUTHORITY, 
                Arrays.<Type>asList(new org.web3j.abi.datatypes.Address(160, target), 
                new org.web3j.abi.datatypes.Address(160, newAuthority)), 
                Collections.<TypeReference<?>>emptyList());
        return executeRemoteCallTransaction(function);
    }

    @Deprecated
    public static IAccessManager load(String contractAddress, Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        return new IAccessManager(contractAddress, web3j, credentials, gasPrice, gasLimit);
    }

    @Deprecated
    public static IAccessManager load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return new IAccessManager(contractAddress, web3j, transactionManager, gasPrice, gasLimit);
    }

    public static IAccessManager load(String contractAddress, Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        return new IAccessManager(contractAddress, web3j, credentials, contractGasProvider);
    }

    public static IAccessManager load(String contractAddress, Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return new IAccessManager(contractAddress, web3j, transactionManager, contractGasProvider);
    }

    public static RemoteCall<IAccessManager> deploy(Web3j web3j, Credentials credentials,
            ContractGasProvider contractGasProvider) {
        return deployRemoteCall(IAccessManager.class, web3j, credentials, contractGasProvider, getDeploymentBinary(), "");
    }

    @Deprecated
    public static RemoteCall<IAccessManager> deploy(Web3j web3j, Credentials credentials,
            BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(IAccessManager.class, web3j, credentials, gasPrice, gasLimit, getDeploymentBinary(), "");
    }

    public static RemoteCall<IAccessManager> deploy(Web3j web3j,
            TransactionManager transactionManager, ContractGasProvider contractGasProvider) {
        return deployRemoteCall(IAccessManager.class, web3j, transactionManager, contractGasProvider, getDeploymentBinary(), "");
    }

    @Deprecated
    public static RemoteCall<IAccessManager> deploy(Web3j web3j,
            TransactionManager transactionManager, BigInteger gasPrice, BigInteger gasLimit) {
        return deployRemoteCall(IAccessManager.class, web3j, transactionManager, gasPrice, gasLimit, getDeploymentBinary(), "");
    }

    public static void linkLibraries(List<Contract.LinkReference> references) {
        librariesLinkedBinary = linkBinaryWithReferences(BINARY, references);
    }

    private static String getDeploymentBinary() {
        if (librariesLinkedBinary != null) {
            return librariesLinkedBinary;
        } else {
            return BINARY;
        }
    }

    public static class OperationCanceledEventResponse extends BaseEventResponse {
        public byte[] operationId;

        public BigInteger nonce;
    }

    public static class OperationExecutedEventResponse extends BaseEventResponse {
        public byte[] operationId;

        public BigInteger nonce;
    }

    public static class OperationScheduledEventResponse extends BaseEventResponse {
        public byte[] operationId;

        public BigInteger nonce;

        public BigInteger schedule;

        public String caller;

        public String target;

        public byte[] data;
    }

    public static class RoleAdminChangedEventResponse extends BaseEventResponse {
        public BigInteger roleId;

        public BigInteger admin;
    }

    public static class RoleGrantDelayChangedEventResponse extends BaseEventResponse {
        public BigInteger roleId;

        public BigInteger delay;

        public BigInteger since;
    }

    public static class RoleGrantedEventResponse extends BaseEventResponse {
        public BigInteger roleId;

        public String account;

        public BigInteger delay;

        public BigInteger since;

        public Boolean newMember;
    }

    public static class RoleGuardianChangedEventResponse extends BaseEventResponse {
        public BigInteger roleId;

        public BigInteger guardian;
    }

    public static class RoleLabelEventResponse extends BaseEventResponse {
        public BigInteger roleId;

        public String label;
    }

    public static class RoleRevokedEventResponse extends BaseEventResponse {
        public BigInteger roleId;

        public String account;
    }

    public static class TargetAdminDelayUpdatedEventResponse extends BaseEventResponse {
        public String target;

        public BigInteger delay;

        public BigInteger since;
    }

    public static class TargetClosedEventResponse extends BaseEventResponse {
        public String target;

        public Boolean closed;
    }

    public static class TargetFunctionRoleUpdatedEventResponse extends BaseEventResponse {
        public String target;

        public BigInteger roleId;

        public byte[] selector;
    }
}
